package com.cysion.study.adapter

import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.cysion.study.ktbox.base.BaseAdapter
import com.cysion.study.ktbox.base.BaseViewHolder
import com.cysion.other._setOnClickListener
import com.cysion.study.R
import kotlinx.android.synthetic.main.item_activity_no.view.*

/**
 * Created by chu on 2019-06-30.
 */
class ActivityNoAdapter(mEntities: MutableList<String>, mContext: Context) :
    BaseAdapter<String>(mEntities, mContext) {
    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BaseViewHolder<String> {
        return SourceHolder(
            LayoutInflater.from(mContext).inflate(R.layout.item_activity_no, parent, false)
        )
    }

    companion object {
        const val look = 101
        const val know = 102
        const val comment = 103

    }

    class SourceHolder(itemView: View) : BaseViewHolder<String>(itemView) {
        override fun fillData(obj: String, position: Int) {
            obj?.apply {
//                itemView.tv_data.text=
                itemView.tv_look._setOnClickListener {
                    //去考核
                    mOnTypeClickListener?.invoke(obj, position, look)
                }

            }
        }
    }
}